<template>
  <div class="ele-goods-evaluate">
    <div class="ele-food-title">商品评价</div>
    <div class="evaluate-btn-item">
      <span
        class="evaluate-btn"
        :class="[btnIndex == value.key ? 'noraml-btn' : '']"
          v-for="(value,index) in btnList"
        @click="handlerBtnClick(value.key)"
        >{{ value.text }}</span
      >
    </div>
    <div class="evaluate-filter" @click="radioCheck">
      <span
        class="iconfont elechenggong"
        :class="[isCheck ? 'isCheck' : 'normal-check']"
      ></span>
      <span class="filter-text">只看评价内容</span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    btnList: {default:()=>[]},
    btnIndex: Number,
    isCheck: false,
  },
  data() {
    return {
    };
  },
  methods: {
    handlerBtnClick(Value) {
      this.$emit("handlerBtnClick", Value);
    },
    radioCheck() {
      this.$emit("radioCheck", !this.isCheck);
    },
  }
};
</script>

<style scoped>

.ele-goods-evaluate {
  padding: 18px 12px 0 18px;
}
.evaluate-btn {
  padding: 8px 12px;
  margin-right: 8px;
  font-size: 12px;
  line-height: 32px;
  border-radius: 4px;
}
.ele-food-title {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: rgb(7, 17, 27);
}
.noraml-btn {
  background-color: rgba(0, 160, 220, 0.2);
  color: rgb(77, 85, 93);
}
.evaluate-filter {
  margin-top: 16px;
  position: relative;
}

.evaluate-filter::before {
  content: "";
  position: absolute;
  top: 0;
  height: 1px;
  width: 100%;
  background-color: rgba(7, 17, 27, 0.1);
}
.isCheck {
  color: #e57373;
}
.normal-check {
  color: grey;
}
.filter-text {
  margin-left: 4px;
  color: rgb(147, 153, 159);
  line-height: 48px;
}
</style>
